package service;

import Pojo.Paid;
import Pojo.QueryVo;
import Pojo.Topaid;
import dao.PaidMapper;
import dao.TopaidMapper;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class TopaidServiceImpl
  implements TopaidService
{

  @Autowired
  private TopaidMapper topaidMapper;

  @Autowired
  private PaidMapper paidMapper;

  public void inserttopaid(Topaid topaid)
  {
    topaid.setStatus("租金未缴");
    this.topaidMapper.inserttopaid(topaid);
  }

  public List<Topaid> findtopaid(QueryVo vo) {
    List list = this.topaidMapper.findtopaid(vo);
    return list;
  }

  public Topaid findbyid(Integer id) {
    Topaid topaid = this.topaidMapper.findbyid(id);
    return topaid;
  }

  public void gotopay(Integer id, Paid paid) {
    this.paidMapper.insertpaid(paid);
    this.topaidMapper.deletetopaid(id);
  }
}